#include <stdio.h>

int countDigits(int num)
{
    int digits[10] = {0};
    int count = 0;
    int sum = 0;
    int temp = num; // 用temp 保存num 的数值
    while (num > 0)
    {
        digits[count++] = num % 10;
        num /= 10; // 这一步运行完成后的num = 0
    }

    for (int i = 0; i < count; i++)
    {
        if (temp % digits[i] == 0)
        {
            sum++;
        }
    }
    return sum;
}

int main()
{
    int num = 121;
    printf("The number of digits that can divide %d is %d\n", num, countDigits(num));
    return 0;
}